package cn.iocoder.yudao.module.product.dal.mysql.emissionsource;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.product.dal.dataobject.emissionsource.EmissionSourceDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.product.controller.admin.emissionsource.vo.*;

/**
 * 排放源 Mapper
 *
 * @author wcl
 */
@Mapper
public interface EmissionSourceMapper extends BaseMapperX<EmissionSourceDO> {
    default PageResult<EmissionSourceDO> selectPage(EmissionSourcePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<EmissionSourceDO>()
                .likeIfPresent(EmissionSourceDO::getName, reqVO.getName())
                .eqIfPresent(EmissionSourceDO::getType, reqVO.getType())
                .eqIfPresent(EmissionSourceDO::getMatchType, reqVO.getMatchType())
                .eqIfPresent(EmissionSourceDO::getFactor, reqVO.getFactor())
                .betweenIfPresent(EmissionSourceDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(EmissionSourceDO::getId));
    }
}
